home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1994, by WATCOM International Inc. All rights %
- % reserved. No part of this software may be reproduced or %
- % used in any form or by any means - graphic, electronic or %
- % mechanical, including photocopying, recording, taping or %
- % information storage and retrieval systems - except with the %
- % written permission of WATCOM International Inc. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- /*************************************************************************
- *
- * WToolTip -- Wrapper for the Windows 95 ToolTip control.
- *
- * Events:
- *
- *************************************************************************/
-
- #ifndef _WTOOLTIP_HPP_INCLUDED
- #define _WTOOLTIP_HPP_INCLUDED
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- #ifndef _WCONTROL_HPP_INCLUDED
- # include "wcontrol.hpp"
- #endif
- #ifndef _WWINDOW_HPP_INCLUDED
- # include "wwindow.hpp"
- #endif
- #ifndef _WVECTOR_HPP_INCLUDED
- # include "wvector.hpp"
- #endif
-
- class WToolTip;
-
- enum WToolTipIdentifierType {
- WToolTipWindowHandle,
- WToolTipIdentifier
- };
-
- enum WToolTipDuration {
- WToolTipAutomaticDuration,
- WToolTipReshowDuration,
- WToolTipAutoPopDuration,
- WToolTipInitialDuration,
- };
-
- //
- // ToolTip styles
- //
-
- #define WTOOLTSDefault ((WStyle)0x00000001L) // TTS_ALWAYSTIP
- #define WTOOLTSAlwaysTip ((WStyle)0x00000001L) // TTS_ALWAYSTIP
- #define WTOOLTSNoPrefix ((WStyle)0x00000002L) // TTS_NOPREFIX
-
- class WCMCLASS WToolTip : public WControl {
- WDeclareSubclass( WToolTip, WControl );
-
- public:
-
- /**********************************************************
- * Constructors and Destructors
- *********************************************************/
-
- WToolTip();
-
- ~WToolTip();
-
- /**********************************************************
- * Properties
- *********************************************************/
-
- // Count
-
- WInt GetCount() const;
-
- // DelayTime
-
- WBool SetDelayTime( WInt milliseconds=500,
- WToolTipDuration duration=WToolTipAutomaticDuration );
-
- /**********************************************************
- * Methods
- *********************************************************/
-
- // Activate
-
- void Activate();
-
- // Add
-
- WBool Add( WWindow * parent, WToolTipIdentifierType type,
- const WRect & rect, const char * text=NULL,
- WWindow * window=NULL, WLong id=0,
- WBool getTextFromParent=FALSE );
-
- // Deactivate
-
- void Deactivate();
-
- // Delete
-
- WBool Delete( WLong itemNumber );
-
- // DeleteAll
-
- WBool DeleteAll();
-
- // Retrieve
-
- WLong Retrieve( const WPoint & pt, WWindow * win=NULL );
-
- /**********************************************************
- * Item Properties
- *********************************************************/
-
- // ID
-
- void SetID( WLong itemNumber, WLong id );
- WLong GetID( WLong itemNumber ) const;
-
- // Parent
-
- WBool SetParent( WLong itemNumber, WWindow * parent );
- WWindow * GetParent( WLong itemNumber );
-
- // Rectangle
-
- WBool SetRectangle( WLong itemNumber, const WRect & rect );
- WRect GetRectangle( WLong itemNumber );
-
- // Text
-
- WBool SetText( WLong itemNumber, const WString & str );
- WString GetText( WLong itemNumber );
-
- // Type
-
- void SetType( WLong itemNumber, WToolTipIdentifierType type );
- WToolTipIdentifierType GetType( WLong itemNumber );
-
- // Window
-
- void SetWindow( WLong itemNumber, WWindow * window );
- WWindow * GetWindow( WLong itemNumber );
-
- /**********************************************************
- * Event handlers
- *********************************************************/
-
- WBool CreateEventHandler( WWindow * window, WEventData * event );
-
- /**********************************************************
- * Overrides
- *********************************************************/
-
- virtual WBool SetParent( const WWindow * parent );
-
- virtual WWindow * GetParent() const;
-
- virtual WBool SetRectangle( const WRect & rectangle,
- WBool update=TRUE );
-
- virtual WRect GetRectangle( WBool absolute=FALSE ) const;
-
- virtual WBool SetText( const WString & text );
-
- virtual WString GetText() const;
-
- virtual const WChar * InitializeClass();
-
- virtual WStyle GetDefaultStyle() const;
-
- virtual WBool SetFont( const WFont & font, WBool preserveSize=TRUE );
-
- virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
- void * data=NULL );
-
- virtual WBool LoadWindow( WWindow * parent,
- const WResourceID & id,
- WModuleHandle module=_ApplicationModule );
-
- virtual WBool MakeWindow( WWindow * parent, WUInt id,
- const WChar * className,
- const WChar * title, const WRect & r,
- WStyle wstyle, WStyle exStyle,
- void * data=NULL );
-
- private:
-
- WBool _ignore;
- };
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WTOOLTIP_HPP_INCLUDED
-